/**
 * @Author: xzm
 * @Date: 2019/9/11
 */
import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 分页查询已建档经销商数据
export const getClubList = _params => axios.get(`${SERVER.CMSCLOUD_BIGCUSTOMER}/clue/majorClue`, { params: _params, menuId: '-1' });
// 车厂分配大客户区域经理线索分页查询（增加-大客户经理名称翻译）
export const getAssignManagerClueList = _params => axios.get(`${SERVER.CMSCLOUD_BIGCUSTOMER}/clue/majorClue/assign/manager`, { params: _params, menuId: '-1' });
// 大客户区域经理分配经销商线索分页查询（限制只能查询分配给该区域经理线索）
export const getAssignDealerClueList = _params => axios.get(`${SERVER.CMSCLOUD_BIGCUSTOMER}/clue/majorClue/assign/dealer`, { params: _params, menuId: '-1' });
// 查询线索明细
export const getClubById = id => axios.get(`${SERVER.CMSCLOUD_BIGCUSTOMER}/clue/majorClue/${id}`, { params: { id: id }, menuId: '-1' });
// 保存线索信息
export const insertClub = params => axios.post(`${SERVER.CMSCLOUD_BIGCUSTOMER}/clue/majorClue`, params, { menuId: '-1' });
// 修改线索信息
export const updateClub = (id, params) => axios.put(`${SERVER.CMSCLOUD_BIGCUSTOMER}/clue/majorClue/${id}`, params, { menuId: '-1' });
// 删除单条线索信息
export const deleteClubById = id => axios.delete(`${SERVER.CMSCLOUD_BIGCUSTOMER}/clue/majorClue/${id}`, { params: { id: id }, menuId: '-1' });
// 批量删除线索信息
export const deleteClubByIds = ids => axios.delete(`${SERVER.CMSCLOUD_BIGCUSTOMER}/clue/majorClue/batch/${ids}`, { params: { ids: ids }, menuId: '-1' });
// 修改线索信息
export const oemAssignClub = (managerIds, params) => axios.put(`${SERVER.CMSCLOUD_BIGCUSTOMER}/clue/majorClue/assign/manager/${managerIds}`, params, { menuId: '-1' });
// 修改线索信息
export const areaAssignClub = (dealerId, params) => axios.put(`${SERVER.CMSCLOUD_BIGCUSTOMER}/clue/majorClue/assign/dealer/${dealerId}`, params, { menuId: '-1' });
// 车厂端大客户线索查询分页查询（根据登录人区分大客户经理和其他角色查询）
export const getOemClueList = _params => axios.get(`${SERVER.CMSCLOUD_BIGCUSTOMER}/clue/majorClue/oem`, { params: _params, menuId: '-1' });
// 经销商端大客户线索查询分页查询（只能查询到分配给自己的线索和自己创建的线索）
export const getDealerClueList = _params => axios.get(`${SERVER.CMSCLOUD_BIGCUSTOMER}/clue/majorClue/dealer`, { params: _params, menuId: '-1' });
// 车厂端大客户线索查询导出（根据登录人区分大客户经理和其他角色查询）
export const exportOemClueList = params => axios.post(`${SERVER.CMSCLOUD_BIGCUSTOMER}/clue/majorClue/oem`, params, { responseType: 'arraybuffer', menuId: '-1' });
// 经销商端大客户线索查询导出（只能查询到分配给自己的线索和自己创建的线索）
export const exportDealerClueList = params => axios.post(`${SERVER.CMSCLOUD_BIGCUSTOMER}/clue/majorClue/dealer`, params, { responseType: 'arraybuffer', menuId: '-1' });

//车场分配给区域经理的线索记录列表信息查询
export const getFPQUList = params => axios.get(`${SERVER.CMSCLOUD_BIGCUSTOMER}/clue/majorClueManager/getOemFPQUList`, { params });
//区域经理分配给经销商的线索记录列表信息查询
export const getFPDLRList = params => axios.get(`${SERVER.CMSCLOUD_BIGCUSTOMER}/clue/majorClueDealer/getFPDLRList`, { params });
